<template>
    <div>
        <button type="button" @click="getInfo">获取 mock 数据</button>
        <div>
            <p v-for="(item, index) in news" :key="index">{{ item.title }}</p>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            news: []
        }
    },
    methods: {
        getInfo() {
            Promise.all([
                this.$api.get('mock/news/list'),
                this.$api.get('mock/news/list')
            ]).then(res => {
                this.news = res[0].data.list.concat(
                    res[1].data.list
                )
            })
        }
    }
}
</script>

<style lang="scss" scoped>
img {
    display: block;
    width: 300px;
}
</style>
